package br.edu.fanor.geract.entity;

import java.io.Serializable;
import java.sql.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

@Entity
@Table(name="Compartilhamentos")
public class Compartilhamentos implements Serializable{

	private static final long serialVersionUID = -8826054235479497398L;
	
	@Id
	@SequenceGenerator(name="SeqCompartilhamento", sequenceName="SeqCompartilhamento", allocationSize=1)
	@GeneratedValue(generator="SeqCompartilhamento", strategy=GenerationType.SEQUENCE)
	@Column(name="IdCompartilhamento")
	private Long id;
	
	@NotNull
	@Column(name="DataCompartilhamento")
	private Date datacompartilhamento;
	
	
	@Column(name="Permissao")
	private Boolean permissao;


	public Long getId() {
		return id;
	}


	public void setId(Long id) {
		this.id = id;
	}


	public Date getDatacompartilhamento() {
		return datacompartilhamento;
	}


	public void setDatacompartilhamento(Date datacompartilhamento) {
		this.datacompartilhamento = datacompartilhamento;
	}


	public Boolean getPermissao() {
		return permissao;
	}


	public void setPermissao(Boolean permissao) {
		this.permissao = permissao;
	}


	@Override
	public String toString() {
		return "Compartilhamentos [id=" + id + ", datacompartilhamento="
				+ datacompartilhamento + ", permissao=" + permissao + "]";
	}


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}


	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Compartilhamentos other = (Compartilhamentos) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	
		
	
}
